<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.tjtt.common.utils.DateUtilsAll"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String mainid = request.getParameter("mainid");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base target="_self"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=path %>/jqGrid/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=path %>/jslib/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js" defer="defer"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <c:if test="${requestScope.message!=null}">
		<script type="text/javascript">
 	 		     alert('<c:out value="${requestScope.message}"></c:out>');
 	 		     window.close();
 		</script>
	</c:if>
		
  </head>
  	<script type="text/javascript">
  		var api = frameElement.api, W = api.opener;
    var stateValue="";
    $().ready(function(){
			var options = {
		  	    url:'<%=request.getContextPath() %>/shebeiweibaoAction!weibaoFlowFaqi.action',
		  	     beforeSubmit: function() {
		   				return checking();
		    			},
		  	    dataType:'json',
		  	    success: function(data) {
		  	      if(data.result=='success'){
					alert("提交成功");
					api.close();
					W.refreshIt();
		  	      }
		  	    }};
		$('#saveBtn').click(function(){
			    	$('#pageFrom').ajaxSubmit(options);
	 	            return false;
    	 });
    	$('#closeBtn').click(function(){
    		api.close();
			//window.close();
		});
		
	});
		
		function checking(){
	   		var flag = true;
			var xiugaimiaoshu = $("#xiugaimiaoshu").val();
			var biangengyuanyin = $("#biangengyuanyin").val();
			
			if(xiugaimiaoshu == null && xiugaimiaoshu == ""){
				alert("修改描述不能为空！");
				$("#xiugaimiaoshu").focus();
	    		return false;
			}
			if(biangengyuanyin == null && biangengyuanyin == ""){
				alert("变更原因不能为空！");
				$("#biangengyuanyin").focus();
	    		return false;
			}
		}
		
		
		
		function changevalue(id){
	 	var flag = "0";
	 	if(id == 1){
	 		var fileValue = document.getElementById("file2").value;
	 		var a=fileValue.lastIndexOf("\\");
	 		var filename = fileValue.substring(a+1);
			document.getElementById("app_annex_reason").value=filename;
			flag = "1";
		}
		document.getElementById("flag").value=flag;
	}
		
  		//选择设备
  		function selectequ(){
  			var datas = window.showModalDialog("<%=request.getContextPath() %>/view/shebeiweibao_list.jsp", window, "dialogWidth:900px;status:no;dialogHeight:500px");
    		if(typeof(datas) == 'undefined'){
    		
			}else{
				var json1 = eval('(' + datas + ')');
				 document.getElementById("shebeiid").value = json1.shebeiid;
				 document.getElementById("shebeiname").value = json1.shebeiname;
				 document.getElementById("shebeino").value = json1.shebeino;
				 document.getElementById("weibaoxiangmu").value = json1.weibaoxiangmu;
				 document.getElementById("weibaojizhun").value = json1.weibaojizhun;
				 document.getElementById("celiangbianliang").value = json1.celiangbianliang;
				 document.getElementById("caozuoyaodian").value = json1.caozuoyaodian;
				 document.getElementById("tixingtianshu").value = json1.tixingtianshu;
				 document.getElementById("gugexinghao").value = json1.gugexinghao;
				 document.getElementById("bumenid").value = json1.bumenid;
				 document.getElementById("bumenname").value = json1.bumenname;
				 document.getElementById("xuhao").value = json1.xuhao;
				 document.getElementById("baoyangjibie").value = json1.baoyangjibie;
				 document.getElementById("gongju").value = json1.gongju;
				 document.getElementById("laobao").value = json1.laobao;
				 document.getElementById("baoyangzhouqi").value = json1.baoyangzhouqi;
				 document.getElementById("shangciweibaotime").value = json1.shangciweibaotime;
			}
  		}
    		
  	</script>
  <body>
    <form id="pageFrom" action="" enctype="multipart/form-data" method="post">
        <input type="hidden" id="flag" name="flag" />
        
        <input type="hidden" name="flowid" id="flowid" value="${flowid}">
     	<input type="hidden" name="stateid" id="stateid" value="${stateid}">
     	${steptcontent}
     	<input type="hidden" name="id" id="id" value="${requestScope.id}">
  		<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew" style="padding-top: 20px">
  			 <tr>
			  <td align="right">流程名称:</td>
     		<td>
     		<script>
     		  	document.write('<input type="text" id="flowname" name="flowname" maxlength="50" value="设备维护保养标准与计划变更流程" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;">');
     		</script>
     		<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img></td>
  			</tr>
  			<tr>
  			  <td align="right">设备名称：</td>
  			  <td align="left">
  			    <input type="hidden" readonly="readonly" id="shebeiid" name="shebeiid" value=" "/>
  			    <input  type="text" readonly="readonly" id="shebeiname" maxlength="50" name="shebeiname" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			    <img src="<%=request.getContextPath() %>/web/images/form_icon_1.gif" style="cursor:hand; vertical-align: middle;" onclick="selectequ()" />
  			  </td>
  			  <td align="right">设备编号：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="shebeino" maxlength="50" name="shebeino" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">规格型号：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="gugexinghao" maxlength="50" name="gugexinghao" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">部门：</td>
  			  <td align="left">
  			  	<input type="hidden" readonly="readonly" id="bumenid" name="bumenid" value=" "/>
  			    <input  type="text" readonly="readonly" id="bumenname" maxlength="50" name="bumenname" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">序号：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="xuhao" maxlength="50" name="xuhao" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">维护保养项目：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="weibaoxiangmu" maxlength="50" name="weibaoxiangmu"  style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">维护保养基准：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="weibaojizhun" maxlength="50" name="weibaojizhun" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">测量变量的方法：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly"  id="celiangbianliang" maxlength="50" name="celiangbianliang"  style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">保养级别：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="baoyangjibie" maxlength="50" name="baoyangjibie" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">工具：</td>
  			  <td align="left">
  			  	 <input  type="text" readonly="readonly" id="gongju" readonly maxlength="50"  name="gongju" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  	 <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">劳保：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="laobao" maxlength="50" name="laobao" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">操作要点：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="caozuoyaodian" maxlength="50" name="caozuoyaodian" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			 	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">保养周期: </td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="baoyangzhouqi" readonly maxlength="50" name="baoyangzhouqi" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			 <td align="right">上次维护时间：</td>
  			  <td align="left">
  			    <input  type="text" readonly="readonly" id="shangciweibaotime" readonly maxlength="50" name="shangciweibaotime" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">提前提醒天数:</td>
  			  <td align="left">
  			    <input  type="text"  id="tixingtianshu"  maxlength="50" name="tixingtianshu" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
 			<tr>
  			  <td align="right">修改描述:</td>
  			  <td align="left">
  			    <input  type="text"  id="xiugaimiaoshu"  maxlength="50" name="xiugaimiaoshu" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  </td>
  			  <td align="right">更改原因：</td>
  			  <td align="left">
  			  	<input type="hidden" readonly="readonly" id="userid" name="userid" value="<%=session.getAttribute("TDM_USER_ID") %>"/>
  			  	<input type="hidden" readonly="readonly" id="username" name="username" value="<%=session.getAttribute("username") %>"/>
  			    <input  type="text"  id="genggaiyuanyin"  maxlength="50" name="genggaiyuanyin"  style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  </td>
  			</tr>
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
		  <tr>   
			<td align="center">
		    	<input id="saveBtn" type="button" value="提 交" class="form_bt_orange" />
		    	<input type="button" id="closeBtn" value="取 消" class="form_bt_grey" />
		    </td>
		  </tr>
		</table>
	<!--表单结束-->
	</form>
  </body>
</html>
